﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="list.aspx.vb" Inherits="JamaicanKitchen.list" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        <asp:Button ID="Button1" runat="server" Text="Add a Recipe" 
            PostBackUrl="~/addNewDish.aspx" Width="100px" />
        

        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="ID" DataSourceID="SqlDataSource1" 
            AllowSorting="True">
            <Columns>
                <asp:HyperLinkField DataNavigateUrlFields="ID" 
                    DataNavigateUrlFormatString="details.aspx?ID={0}" DataTextField="FoodName" />
                <asp:BoundField DataField="Ingredients" HeaderText="Ingredients" 
                    SortExpression="Ingredients" />
                <asp:BoundField DataField="DirectionToPrepare" HeaderText="DirectionToPrepare" 
                    SortExpression="DirectionToPrepare" />
                <asp:BoundField DataField="ServingSuggestion" HeaderText="ServingSuggestion" 
                    SortExpression="ServingSuggestion" />
                <asp:BoundField DataField="AverageCookingTime" HeaderText="AverageCookingTime" 
                    SortExpression="AverageCookingTime" />
                <asp:BoundField DataField="RatingStars" HeaderText="RatingStars" 
                    SortExpression="RatingStars" />
                <asp:ImageField DataImageUrlField="FoodImage" HeaderText="Thumbnail">
                    <ControlStyle Height="170px" Width="170px" />
                </asp:ImageField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:JamaicanConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:JamaicanConnectionString.ProviderName %>" 
            
            SelectCommand="SELECT [FoodName], [FoodImage], [Ingredients], [DirectionToPrepare], [ServingSuggestion], [AverageCookingTime], [RatingStars], [ID] FROM [jamaicankitchen] ORDER BY [ID] DESC">
        </asp:SqlDataSource>
</p>
    <p>
        Display these varieties of dishes</p>
    <p>
        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
            DataKeyNames="ID" DataSourceID="SqlDataSource2">
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" 
                    ReadOnly="True" SortExpression="ID" />
                <asp:HyperLinkField DataNavigateUrlFields="TagName" 
                    DataNavigateUrlFormatString="DishByTags.aspx?TagName={0}" 
                    DataTextField="TagName" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:JamaicanConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:JamaicanConnectionString.ProviderName %>" 
            SelectCommand="SELECT [ID], [TagName] FROM [Tags]"></asp:SqlDataSource>
</p>
    <p>
        &nbsp;</p>
    <p>
        <asp:TextBox ID="tb_tagSearch" runat="server" Width="279px"></asp:TextBox>
        <asp:Button ID="btn_tagSearch" runat="server" Height="32px" Text="Button" 
            Width="97px" />
    <br />
</p>
<p>
</p>
<p>
</p>
</asp:Content>
